const { Schema, model } = require('mongoose');
const { ObjectId } = require('bson');

const userSchema = new Schema({
    username: String,
    password: String,
    online: Boolean,
    /**
     * @property { Array<PlayerItem> }
     */
    players: Array,
});

exports.PlayerItem = class {
    id = new ObjectId;
    name = '';
    property = {}
}

exports.UserModel = model('User', userSchema);
exports.userSchema = userSchema;
